# -*- coding: utf-8 -*-
from django.db import models
import sys

class Message(models.Model):
    msgtype=models.TextField(verbose_name='消息类型（wechat,qywechat,sms,email）',blank=True, null=True)
    messagejson=models.TextField(verbose_name='消息体',blank=True, null=True)
    touser=models.CharField(max_length=120,verbose_name='发送对象',blank=True, null=True)
    status = models.IntegerField(verbose_name='状态1需要发送，0已发送',default=1)
    createtime=models.DateTimeField(auto_now_add=True,verbose_name='创建时间')
    pushtime=models.DateTimeField(verbose_name='推送时间',blank=True, null=True)
    projectjson = models.TextField(verbose_name='应用信息',blank=True, null=True)
    resultstatus = models.IntegerField(verbose_name='发送状态1发送成功，2发送失败,0未发送',default=0)
    resultinfo = models.TextField(verbose_name='返回内容',blank=True, null=True)

    class Meta:
        verbose_name = '消息体'
        verbose_name_plural = '消息体'
        db_table = 'message'
    def __str__(self):
        return str(self.id)
